package main

import (
	"fmt"
	"github.com/golang/protobuf/proto"
	"go_rpc/rpc/hello"
)

type Person struct {
	Name string `json:"name"`
	Age  int32  `json:"age"`
}

func main() {
	var p = &hello.Person{Name: "张三", Age: 26}
	marshal, _ := proto.Marshal(p)
	var p0 = &hello.Person{}
	_ = proto.Unmarshal(marshal, p0)
	fmt.Println(p0)
	fmt.Println(len(marshal))
	//var jp = &Person{Name: "zhangsan", Age: 26}
	//bytes, _ := json.Marshal(jp)
	//fmt.Println(len(bytes))
}
